A Simple Object Access Protocol Application Programming Interface (SOAP API, Simple Object Access Protocol Application Programming Interface) is an interface for implementing interconnection and interworking between application software systems based on a Web service mechanism. The SOAP API allows application software developed by using different operating systems and different languages to easily implement interworking. A complete SOAP API message includes a message header (header bearer) and a message body (body bearer). The message header is used to bear common information for common processing such as authorization. The message body is used to bear service-related information for service-related processing.
A Representational State Transfer Application Programming Interface (REST API, Representational State Transfer Application Programming Interface) is a common interoperable interface between Internet-based WEB application capabilities, that is, an API complying with the REST style. A system corresponding to the API complying with the REST style is a REST-style system. Features of the REST-style system include the followings: externally open information is a resource, where the resource is identified by a Uniform Resource Identifier (URI, Uniform Resource Identifier) of conventional WEB technologies; only four operations are allowed for the externally open resource, including add, modify, delete, and get, which respectively correspond to Post (add), Put (modify), Delete (delete) and Get (get) in the Hyper text Transfer Protocol (HTTP, Hyper Text Transfer Protocol) of conventional WEB technologies.
With the fast development of the Internet, it is expected that all capabilities may be open to the Internet. For example, a conventional application system using Web services starts to open to the Internet. Therefore, it is necessary to open the SOAP API as a corresponding REST API (that is, convert the SOAP API into the REST API). When the SOAP API is opened as the corresponding REST API, contents of the service part will be abstracted into resources, and the SOAP common message header part requires a common bearer point in the new REST API interface. Because WEB technologies use the HTTP protocol, HTTP message headers of the HTTP protocol of WEB applications mainly bear fields related to negotiation between HTTP protocol clients and servers, and HTTP message bodies mainly bear service messages. As a result, when the SOAP API is converted into the REST API, it is necessary to find an appropriate position in HTTP to carry the relevant content of a SOAP message header.
A prior art 1 provides a solution for converting the SOAP API into the REST API, which is extending HTTP message header fields by adding contents which are to be carried by SOAP header and prefixed with X, as follows:
POSThttp://www.example.com/sms/1.0/smsmessaging/outbound/100860001/requests HTTP/1.1Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==Accept: application/xmlContent-Type: application/xml; charset=UTF-8Host: example.com:80X-Partner-Id:3500001X-Service-Id:35000010001
This extension results in too many header field names in HTTP protocol fields, which is confusing. In addition, the extension of HTTP protocol fields is normally related to a bottom-layer negotiation mechanism between HTTP protocol clients and servers, and this extension reduces the processing speed of bottom-layer negotiation between the clients and the servers.
A prior art 2 provides a solution for converting the SOAP API into the REST API, which is carrying a SOAP message header in an HTTP message body.
However, because an HTTP message body mainly bears service messages, the inclusion of message header contents in an XML file of every service message results in strong association between service messages and message headers, and weak independence in file and program processing. In addition, during program processing, the whole service message body must be parsed to complete authorization required by the message header, which results in a low processing speed.
As a result, the prior arts for converting the SOAP API into the REST API have the problem of redundancy and slow message processing.